package com.wzy.service.reposirory.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wzy.service.reposirory.dto.UserGlobalWord;
import com.wzy.service.reposirory.entity.UserWord;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wuzhengyu
 * @since 2021-03-13
 */
@Component
public interface UserWordMapper extends BaseMapper<UserWord> {


    @Select("select user_word.id as id, uid, `status`, spell, explains, `level`, us_phonetic,uk_phonetic, uk_speech, global_word.id as gid " +
            "from user_word, global_word where user_word.gwid = global_word.id and user_word.uid = #{uid} and user_word.sid = #{sid} and user_word.`status` != \"掌握\"")
    List<UserGlobalWord> getUserGlobalWordBySid(String sid, String uid);
}
